package 笔试真题;

import java.util.Scanner;

public class Baidu1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt(); //要放大的倍数
        int[][] values = new int[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                values[i][j] = scanner.nextInt();
            }
        }
        for (int i = 0; i < n; i++) {
            for (int ll = 0; ll < k; ll++) {
                for (int j = 0; j < n; j++) {
                    for (int l = 0; l < k; l++) {
                        System.out.print(values[i][j]+" ");
                    }
                }
                System.out.println("");
            }
        }
    }
}
